package com.gz.springboot.mybatisplus.controller;

import com.gz.springboot.mybatisplus.bean.Monster;
import com.gz.springboot.mybatisplus.service.MonsterService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Controller
public class MonsterController {

    @Resource
    private MonsterService monsterService;

    @ResponseBody
    @GetMapping("/monster")
    public Monster getById(@RequestParam(value = "id") Integer id) {
        return monsterService.getById(id);
    }
}
